package cn.touna.jss.modules.callback.enums;

import cn.touna.risk.api.domain.ResponseService;

/**
 * 魔蝎回调任务类型枚举
 */
public enum MoxieTaskEnum implements ResponseService {
    MOXIE_FUND_BILL("fund_bill", "魔蝎公积金账单"),
    MOXIE_FUND_REPORT("fund_report", "魔蝎公积金报告"),

    MOXIE_SECURITY_BILL("security_bill", "魔蝎社保账单"),
    MOXIE_SECURITY_REPORT("security_report", "魔蝎社保报告"),

    MOXIE_EMAIL_BILL("email_allbill", "魔蝎信用卡邮箱账单"),
    MOXIE_EMAIL_REPORT("email_report", "魔蝎信用卡邮箱报告"),

    MOXIE_ZHENGXIN_BILL("zhengxin_allbill", "魔蝎信用卡邮箱账单"),
    MOXIE_ZHENGXIN_REPORT("zhengxin_report", "魔蝎信用卡邮箱报告");

    private String code;

    private String desc;

    MoxieTaskEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MoxieTaskEnum getDesc(String code) {
        for (MoxieTaskEnum cqr : MoxieTaskEnum.values()) {
            if (cqr.getCode().equals(code)) {
                return cqr;
            }
        }
        return null;
    }

    public boolean equals(String code) {
        return this.code != null && this.code.equals(code);
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String getResponseCode() {
        return code;
    }

    @Override
    public String getResponseMessage() {
        return desc;
    }
}
